import React ,{useState}from 'react';
import './shop.scss'
import {useSelector,useDispatch} from 'react-redux'
import {create_shop_list} from '../../../store/actionCreators'
import {
    Form,
    Input,
    Button,
    Select,
    Cascader,
    Switch,
    Upload,
  } from 'antd';
const { TextArea } = Input;
function Shopmassage(props) {
    const [componentDisabled, setComponentDisabled] = useState(false);
  const onFormLayoutChange = ({ disabled }) => {
    setComponentDisabled(disabled);
  };
  const dispatch = useDispatch()
  var add = ()=>{

  }
  const onFinish = (values) => {
    dispatch(create_shop_list(values))
    console.log('Success:', values);
  };
    return (
        <div className='shopmassage'>
              <div className='shoptop'>
                  <span>设置 / 店铺信息</span>
                  <h2>店铺信息</h2>
              </div>
              <Form
              initialValues={{
                remember: true,
              }}
              onFinish={onFinish}
        labelCol={{
          span: 4,
        }}
        wrapperCol={{
          span: 14,
        }}
        layout="horizontal"
        onValuesChange={onFormLayoutChange}
        disabled={componentDisabled}
      >
        <Form.Item label="店铺名"  name="name">
          <Input />
        </Form.Item>
        <Form.Item label="店铺地址" name="address">
          <Input />
        </Form.Item>
        <Form.Item label="状态" name="status">
          <Select>
            <Select.Option value="1">开业</Select.Option>
            <Select.Option value="2">未开业</Select.Option>
            <Select.Option value="3">倒闭</Select.Option>
          </Select>
        </Form.Item>
        <Form.Item label="客服电话" name="phone">
          <Input />
        </Form.Item>
        <Form.Item label="商户简介" name='title'>
          <TextArea rows={4} />
        </Form.Item>
        <Form.Item label="店铺logo" valuePropName="fileList">
          <Upload action="/upload.do" listType="picture-card">
            <div>
              <div
                style={{
                  marginTop: 8,
                }}
              >
                Upload
              </div>
            </div>
          </Upload>
        </Form.Item>
        <Form.Item label="Button">
          <Button type="primary" htmlType="submit">Button</Button>
        </Form.Item>
     </Form>
        </div>
    );
}

export default Shopmassage;